#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a,b,c,d,e;
	int num = 0;;
	for (a = 1; a <= 9; a++)
	{
		for (b = 1; b <= 9; b++)
		{   if(a!=b)
			for (c = 1; c <= 9; c++)
			{   if(b!=c&&a!=c)
				for (d = 1; d <= 9; d++)
				{    if(a!=d&&c!=d&&b!=d)
					for (e = 1; e <= 9; e++)
					{
						if (a != e && c != e && d !=e&&b!=e)
						if ((a * 10 + b) * ((c * 100) + (d * 10) + e) == (a * 100 + d * 10 + b) * ((c * 10) + e))
							num++;
					}
				}
			}
		}
	}
	printf("%d", num);
}










